package com.BlogPark.controller.exception;

import com.BlogPark.controller.result.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Auther: MFM
 * @Date: 2022/8/10 - 08 - 10 - 22:02
 * @version: 1.0
 * 捕获全局异常
 */

@RestControllerAdvice
public class ProjectExceptionCapture {

    @ExceptionHandler(Exception.class)
    public Result doException(Exception ex) {
        return new Result(Code.SYSTEM_UNKOWN_ERR, "出现未知错误，请稍后重试");
    }
}
